<template>
  <div id="app">
    <div class="common-layout">
    <el-container>
      <el-header class="head">搜索到<span class="num" >0</span>个相关合同信息</el-header>
      <el-main>
          <div class="main-top">
            <span class="bt">
               <el-input v-model="input" class="ipt" placeholder="未审核" />
               <select name="审核状态" id="selt">
                <option value="未审核">未审核</option>
                <option value="已审核">已审核</option>
               </select>
               <el-button type="primary">查询</el-button>
            </span>
          </div>

 <el-table
          ref="multipleTableRef"
          :data="tableData"
          style="width: 100%"
          class="tab"
          @selection-change="handleSelectionChange"
        >
          <el-table-column type="selection" width="40" />
          <el-table-column label="编号" width="45">
            <template #default="scope">{{ scope.row.id }}</template>
          </el-table-column>
          <el-table-column property="htname" label="合同名称" width="120" />
          <el-table-column
            property="jgname"
            label="机构名称"
            show-overflow-tooltip
            width="200"
          />
          <el-table-column
            property="httype"
            label="合同类型"
            show-overflow-tooltip
            width="60"
          />
          <el-table-column
            property="htmoney"
            label="合同总金额"
            show-overflow-tooltip
            width="70"
          />
          <el-table-column property="jbren" label="经办人" width="50" />
          <el-table-column
            property="shzhuangtai"
            label="审核状态"
            show-overflow-tooltip
            width="100"
          />
          <el-table-column property="qgdata" label="签约日期" width="120" />
          <el-table-column property="dqdate" label="到期日期" width="120" />
          <el-table-column prop="address" label="操作">
            <template #default="scope">
              <el-button
                link
                type="primary"
                size="small"
                @click.prevent="editRow(scope.row)"
                >编辑</el-button
              >
              <el-button
                link
                type="primary"
                size="small"
                @click.prevent="deleteRow(scope.row)"
                >删除</el-button
              >
              <el-button
                link
                type="primary"
                size="small"
                @click.prevent="deleteRow(scope.row)"
                >查看</el-button
              >
            </template>
          </el-table-column>
        </el-table>

      </el-main>
    </el-container>
  </div>
  </div>
</template>

<script lang='ts' setup>
import { ref } from 'vue'
import { ElTable } from "element-plus";
const input = ref('')

interface User {
  id: string;
  htname: string;
  jgname: string;
  httype: string;
  htmoney: number;
  jbren: string;
  shzhuangtai: string;
  qgdata: string;
  dqdate: string;
}
const multipleTableRef = ref<InstanceType<typeof ElTable>>();
const multipleSelection = ref<User[]>([]);
const toggleSelection = (rows?: User[]) => {
  if (rows) {
    rows.forEach((row) => {
      multipleTableRef.value!.toggleRowSelection(row, undefined);
    });
  } else {
    multipleTableRef.value!.clearSelection();
  }
};
const handleSelectionChange = (val: User[]) => {
  multipleSelection.value = val;
};
const tableData: User[] = [
  {
    id: "001",
    htname: "博看专区销售合同",
    jgname: "南阳医学高等专科学校图书馆",
    httype: "销售",
    htmoney: 20000.00,
    jbren: "曹晓芳",
    shzhuangtai: "已审核",
    qgdata: "2009-11-04",
    dqdate: "2012-11-04",
  },
  {
    id: "002",
    htname: "博看专区销售合同",
    jgname: "山东工业职业学院图书馆",
    httype: "销售",
    htmoney: 30000.00,
    jbren: "夏小芳",
    shzhuangtai: "已审核",
    qgdata: "2009-11-04",
    dqdate: "2010-11-04",
  },
  {
    id: "003",
    htname: "手机APP销售合同",
    jgname: "闽南理工学院图书馆",
    httype: "销售",
    htmoney: 30000.00,
    jbren: "何雯",
    shzhuangtai: "已审核",
    qgdata: "2009-11-04",
    dqdate: "2012-11-04",
  },
  {
    id: "004",
    htname: "博看专区销售合同",
    jgname: "武汉工程职业技术学院图书馆",
    httype: "销售",
    htmoney: 30000.00,
    jbren: "张雷",
    shzhuangtai: "审核中",
    qgdata: "2009-11-04",
    dqdate: "2012-11-04",
  },
  {
    id: "005",
    htname: "4K触摸屏销售合同",
    jgname: "湖南艺术职业学院图书馆",
    httype: "采购",
    htmoney: 30000.00,
    jbren: "刘倩",
    shzhuangtai: "审核中",
    qgdata: "2009-11-04",
    dqdate: "2012-11-04",
  },
  {
    id: "006",
    htname: "微刊服务销售合同",
    jgname: "重庆城市管理职业学院图书馆",
    httype: "销售",
    htmoney: 30000.00,
    jbren: "赵红雨",
    shzhuangtai: "未审核",
    qgdata: "2009-11-04",
    dqdate: "2012-11-04",
  },
  {
    id: "007",
    htname: "4K触摸屏销售合同",
    jgname: "安徽省宣城市宣州孙埠高级中学",
    httype: "销售",
    htmoney: 30000.00,
    jbren: "夏小芳",
    shzhuangtai: "审核中",
    qgdata: "2009-11-04",
    dqdate: "2012-11-04",
  },
  {
    id: "008",
    htname: "博看专区销售合同",
    jgname: "长治市科技情报研究所",
    httype: "销售",
    htmoney: 30000.00,
    jbren: "张丽",
    shzhuangtai: "审核中",
    qgdata: "2009-11-04",
    dqdate: "2012-11-04",
  },
]
</script>

<style scoped>
.head {
  text-align: center;
  font-weight: bolder;
}
.num{
  color:deepskyblue;
}
.main-top {
  height: 40px;
  display: flex;
  font-size: 15px;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid gainsboro;
  /* background-color: aqua; */
}
.bt{
  width: 450px;
  height: 40px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  /* background-color: aqua; */
}
.ipt{
  width: 280px;
  height: 30px;
}
#selt{
 width: 80px;
  height: 30px;
}
.tab {
  font-size: 13px;
  text-align: center;
}

</style>